<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>课程修改</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
 
 <script src="plug-in/jquery-plugs/form/jquery.form.js"></script>
  <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.config.js"></script>
   <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.all.min.js"> </script> 
   <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/lang/zh-cn/zh-cn.js"></script>
   <script type="text/javascript" src="plug-in/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
   <script type="text/javascript" src="plug-in/Validform/js/Validform_Datatype_zh-cn.js"></script>
   <script type="text/javascript" src="plug-in/Validform/js/datatype_zh-cn.js"></script>
   <link rel="stylesheet" href="plug-in/Validform/css/style.css" type="text/css">
   <link rel="stylesheet" href="plug-in/Validform/css/tablefrom.css" type="text/css">
   
   <!-- 上传文件  -->
    <link rel="stylesheet" type="text/css" href="plug-in/webUploader/css/webuploader.css" />
    <link rel="stylesheet" type="text/css" href="plug-in/webUploader/style.css" />
    <script type="text/javascript" src="plug-in/webUploader/dist/webuploader.js"></script>
    <script type="text/javascript" src="plug-in/webUploader/upload.js"></script>
 </head>
 
 <body>

  <t:formvalid formid="formobj" dialog="true" usePlugin="password" 
  			layout="table" action="labMaterialController.do?doAdd" tiptype="3">
  			<input type="hidden" name="id" value="${obj.id }"/>
		<table style="" cellpadding="0" cellspacing="1" class="formtable">
				<tr>
					<td align="right">
						<label class="Validform_label">
							教材编号:
						</label>
					</td>
					<td class="value">
					     	 <input id="no" name="no" type="text"
					     	 style="width: 150px" class="inputxt"  datatype="*" maxlength="80" value='${obj.no }'>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">教材编号</label>
					</td>
					<td align="right">
						<label class="Validform_label">
							出版社:
						</label>
					</td>
					<td class="value">
					     	 <input id="press" name="press" type="text"
					     	 style="width: 150px" class="inputxt"  datatype="*" maxlength="80" value='${obj.press }'>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">出版社</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							教材名称:
						</label>
					</td>
					<td class="value">
					     	 <input id="name" name="name" type="text"
					     	 style="width: 150px" class="inputxt"  datatype="*" maxlength="80" value='${obj.name }'>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">教材名称</label>
						</td>
					<td align="right">
						<label class="Validform_label">
							作者:
						</label>
					</td>
					<td class="value">
					     	 <input id="author" name="author" type="text"
					     	 style="width: 150px" class="inputxt"  datatype="*" maxlength="80" value='${obj.author }'>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">作者</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							封面照片:
						</label>
					</td> 
					<td class="value" colspan="3"> 
		         		
		         		<c:forEach items="${attList}" var="att">
		         			<div class="prevImg" id="prevImg${att.id}">
		         				<img src="cms-attach.do?get&attachId=${att.id }" style="height:80px;width:80px">
		         				<a onclick='deleteAttach(${att.id})' style="cursor: pointer;">删&nbsp;除</a>
		         			</div>  	 
		         		</c:forEach> 
		         		
		         		 <div id="wrapper">
					        <div id="container">
					            <!--头部，相册选择和格式选择-->
					
					            <div id="uploader">
					                <div class="queueList">
					                    <div id="dndArea" class="placeholder">
					                        <div id="filePicker"></div>
					                        <p>或将照片拖到这里，单次最多可选6张</p>
					                    </div>
					                </div>
					                <div class="statusBar" style="display:none;">
					                    <div class="progress">
					                        <span class="text">0%</span>
					                        <span class="percentage"></span>
					                    </div><div class="info"></div>
					                    <div class="btns">
					                        <div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
					                    </div>
					                </div>
					            </div>
					        </div>
   						</div>
		           </td> 
			  </tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							出版时间:
						</label>
					</td>
					<td class="value" colspan="3">
						<input id="publishYear" name="publishYear" type="text"
					     	 style="width: 150px" class="inputxt"  datatype="n" maxlength="4" value='${obj.publishYear }'>
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">出版时间</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							简介:
						</label>
					</td>
					<td class="value" colspan="3">
					 	<textarea style="width:300px;height:100px;" class="inputxt" rows="6" 
					 		id="description" name="description" maxlength="200">${obj.description }</textarea>
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">简介</label>
					</td>
				</tr>
			</table>
		</t:formvalid>
 </body>  	
 <script>
	 function deleteAttach(id){
		 $('#prevImg'+id).remove();
		 $('#formobj').append("<input type='hidden' name='deletedAttach'  value='"+id+"'/>");
	}
 </script>
